#! /usr/bin/env python
#coding=utf-8
import bz2, cPickle

class tmsData():
    """
    Purpose:
        Load and save data
    """
    def load(self):
        #Load data from file
        fh = bz2.BZ2File('TMS.Data', 'rb',0,1)
        [self.TalkHistory,self.StudyHistory,self.SettingHistory,self.Calendar,self.Students, self.Options, self.SourceMaterial] = cPickle.load(fh)
    
    def save(self):
        #save data from file
        Alldata = [self.TalkHistory,self.StudyHistory,self.SettingHistory,self.Calendar,self.Students, self.Options, self.SourceMaterial]        
        fh = bz2.BZ2File('TMS.Data', 'wb',0,1)
        cPickle.dump(Alldata, fh, cPickle.HIGHEST_PROTOCOL)

